// AccountController.java
package com.imut.onlinebanking.dealings.controller;

import com.imut.onlinebanking.dealings.entity.Account;
import com.imut.onlinebanking.dealings.service.AccountsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/account")
public class AccountController {

    @Autowired
    private AccountsService accountService;

    @GetMapping("/getAccount")
    public List<Account> getAllAccounts() {
        return accountService.getAllAccounts();
    }

    @GetMapping("/page")
    public String showAccountsPage() {
        return "withdrawalRecords"; // 返回 HTML 页面名称
    }
}
